import request from '../utils/request'

// 访客相关接口
export const visitorApi = {
  // 获取访客列表
  getVisitorList: (params) => request.get('/visitor/list', { params }),
  // 提交访客申请
  submitVisitorApplication: (data) => request.post('/visitor/apply', data),
  // 获取访客详情
  getVisitorDetail: (id) => request.get(`/visitor/detail/${id}`),
  // 更新访客状态
  updateVisitorStatus: (data) => request.put('/visitor/status', data)
}

// 用户相关接口
export const userApi = {
  // 用户登录
  login: (data) => request.post('/user/login', data),
  // 获取用户信息
  getUserInfo: () => request.get('/user/info'),
  // 更新用户信息
  updateUserInfo: (data) => request.put('/user/info', data)
}

// 消息相关接口
export const messageApi = {
  // 获取消息列表
  getMessageList: (params) => request.get('/message/list', { params }),
  // 标记消息已读
  markMessageRead: (id) => request.put(`/message/read/${id}`),
  // 删除消息
  deleteMessage: (id) => request.delete(`/message/${id}`)
}